<%-- 
    Document   : download
    Created on : Jul 3, 2013, 10:34:51 AM
    Author     : tuanta
--%>

<%@page import="java.util.Enumeration"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <% 
           try
            {
                String strRequestHeader = request.getHeader("user-agent");
                System.out.println("Now printing all headers...");
                Enumeration<String> e = request.getHeaderNames();
                while(e.hasMoreElements()){
                    String strHeaderName = e.nextElement();
                    System.out.println("Name:" + strHeaderName + ",value:" + request.getHeader(strHeaderName));;
                }
                System.out.println("Printing custom headers...");
                String[] array = {"X-MSISDN","X_MSISDN","HTTP_X_MSISDN","X-UP-CALLING-LINE-ID","X_UP_CALLING_LINE_ID","HTTP_X_UP_CALLING_LINE_ID","X_WAP_NETWORK_CLIENT_MSISDN"};
                for(int i=0;i<array.length;i++){
                    String strHeaderName = array[i];
                    System.out.println("Name:" + strHeaderName + ",value:" + request.getHeader(strHeaderName));;
                }
            }
            finally{
            }
        %>
    </body>
</html>
